<?php 

$auth = @$_SESSION['auth'];
if (empty($auth)) to_login('?c=websocket&a=agreement');

$md5 = dt_query_one("SELECT name, a_m, l_m, p_m, password FROM flex_n_id WHERE user_id = '".$auth['id']."'");

?>
<script src="forum/inc/forum.js"></script>
<link rel="stylesheet" href="forum/inc/forum.css">
<link rel="stylesheet" href="user/inc/user.css">
<?php require_once('forum/inc/pub_h.phtml') ?>
<div class="register">
	<div class="container">
		<div class="row clearfix">
			<div class="col-md-2 column">
			</div>
			<div class="col-md-8 column">
				<div class="user-panel">
					<h3 class="hidden-xs"> 我要HIICI直播 <span class="glyphicon glyphicon-hd-video" aria-hidden="true"></span> <span class="glyphicon glyphicon-share"></span> <span class="glyphicon glyphicon-exclamation-sign"></span> </h3>
					<hr class="hidden-xs">
					<form id="do_agreement" class="form-horizontal" action="javascript:do_agreement()" method="post">
							<div class="form-group hidden-xs">
								<label class="col-md-2"></label>
								<div class="col-md-5">
									<b>直播名 - 标识：</b>
								</div>
							</div>
							<div class="form-group">
								<label class="col-md-2 control-label"></label>  
								<div class="col-md-8">
									<input name="name" type="text" placeholder="直播名" class="form-control input-md" required="" value="<?php echo $md5['name'] ?>">
								</div>
							</div>
							<div class="form-group">
								<label class="col-md-2 control-label"></label>  
								<div class="col-md-2">
									<div class="checkbox"><label><input name="a_m" type="checkbox" <?php if (1 == $md5['a_m']) echo 'checked="checkbox"' ?>> 观众发言 </label></div>
								</div>
								<div class="col-md-2">
									<div class="checkbox"><label><input name="l_m" type="checkbox" <?php if (1 == $md5['l_m']) echo 'checked="checkbox"' ?>> 语音直播 </label></div>
								</div>
							</div>
							<div class="form-group">
								<label class="col-md-2 control-label"></label>  
								<div class="col-md-2">
									<div class="checkbox"><label><input name="p_m" type="checkbox" onclick="check_p_m()" <?php if (1 == $md5['p_m']) echo 'checked="checkbox"' ?>> 加密直播 </label></div>
								</div>
								<div class="col-md-6">
									<input id="password" name="password" type="password" placeholder="************" class="form-control input-md" <?php if (1 != $md5['p_m']) echo 'style="display:none"' ?>>
								</div>
							</div>
							<br>
							<div id="agreement" style="display:none">
								<div class="form-group">
									<label class="col-md-2"></label>
									<div class="col-md-5">
										<b>HIICI直播 - 直播协议：</b>
									</div>
								</div>
								<div class="form-group">
									<label class="col-md-2"></label>
									<div class="col-md-8">
										<p>1、您真正使用HIICI高清直播服务。</p>
										<p>2、此服务禁止直播一切有关淫秽色情、反党、反社会、邪教等不良非法内容节目。</p>
										<p>3、如直播非法内容，一经发现，将立即举报至公安机关。</p>
										<p>4、同意则接受直播非法内容引发的一切责任后果。</p>
									</div>
								</div>
							</div>
							<div class="form-group">
								<label class="col-md-2 control-label"></label>
								<div class="col-md-8">
									<div class="checkbox"><label><input name="agreement" type="checkbox" checked="checked"> 我同意并接受“<a href="javascript:$('div#agreement').toggle()">直播协议</a>” </label></div>
								</div>
							</div>
							<!-- token -->
							<input type="hidden" name="token" value="<?php echo get_token() ?>"/>
							<div class="form-group">
								<label class="col-md-2 control-label hidden-xs"></label>
								<div class="col-md-3 col-xs-5">
									<button class="btn btn-primary btn-block">开始直播</button>
								</div>
								<div class="col-md-5 col-xs-7">
									<a class="btn btn-success btn-block" type="button" href="?c=websocket&a=hiici_ls">去看直播</a>
								</div>
							</div>
					</form>
				</div>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">

$(document).ready(function(){
	$('li#websocket').addClass('active');
});

</script>
